package training.bms.business;

import java.util.Date;

import training.bms.persistence.PostDao;
import training.framework.business.AbstractEntityController;
import training.framework.persistence.AbstractEntityDao;

public class PostController extends AbstractEntityController<Integer, Post, PostSearchOptions>{

	private PostDao dao;

	PostController(PostDao dao) {
		this.dao = dao;
	}
	
	public PostController() {
		dao = new PostDao();
	}
	
	@Override
	protected AbstractEntityDao<Integer, Post, PostSearchOptions> getDao() {
		return this.dao;
	}


	@Override
	protected void validateUpdate(Post entity) {
		
	}

	@Override
	protected void validadeInsert(Post entity) {
		entity.setCreationDate(new Date());
	}

	@Override
	public void validateDelete(Post entity) {
	}
}
